//
//  UIView+ShortCut.m
//  2202-Lottery_TabBar
//
//  Created by 李少葵 on 6/1/16.
//  Copyright © 2016年 myClassroom. All rights reserved.
//

#import "UIView+ShortCut.h"

@implementation UIView (ShortCut)
// setter and getter for height && width
- (CGFloat)height {
    
    return self.frame.size.height;
}
- (void)setHeight:(CGFloat)height {
    
    self.height = height;
}

- (CGFloat)width {
    
    return self.frame.size.width;
}
- (void)setWidth:(CGFloat)width {
    
    self.width = width;
}

// x && y
- (CGFloat)x {
    return self.frame.origin.x;
}
- (void)setX:(CGFloat)x{
    
    CGRect frame = self.frame;
    frame.origin.x = x;
    self.frame = frame;
}

- (CGFloat)y {
    
    return self.frame.origin.y;
}
- (void)setY:(CGFloat)y {
    
    CGRect frame = self.frame;
    frame.origin.y = y;
    self.frame = frame;
}




@end







